package com.zgw.his.design.model;

import org.eclipse.wb.core.model.JavaInfo;
import org.eclipse.wb.gef.core.EditPart;
import org.eclipse.wb.gef.core.IEditPartFactory;
import org.eclipse.wb.internal.core.gef.part.DesignRootEditPart;
import org.eclipse.wb.internal.core.gef.part.nonvisual.NonVisualBeanEditPart;
import org.eclipse.wb.internal.core.model.nonvisual.NonVisualBeanContainerInfo;

import com.zgw.his.design.model.widgets.DatasetEditPart;
import com.zgw.his.design.model.widgets.DatasetEditPart2;
import com.zgw.his.design.model.widgets.DatasetEditPolicy;
import com.zgw.his.design.model.widgets.DatasetInfo;

public class EditPartFactory implements IEditPartFactory {

	public EditPart createEditPart(EditPart context, Object model) {

		if (context instanceof DesignRootEditPart
				&& model instanceof DatasetInfo) {
			// DatasetEditPart p = new DatasetEditPart((DatasetInfo) model);
			NonVisualBeanEditPart p = new NonVisualBeanEditPart(
					(JavaInfo) model);
			p.installEditPolicy(new DatasetEditPolicy((DatasetInfo) model));
			return p;
		}
		return null;
	}
}
